package com.example.entity.domain.user;

import com.baomidou.mybatisplus.annotation.*;
import lombok.*;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@TableName("user") //指定类和数据表的映射关系  如果类名小写后与数据表一致可以省略
public class User {
	@TableId(value = "id", type = IdType.AUTO) //表明主键，如果主键名是id则可以省略 value指定列名，type指定增长策略
	private Long id;
	@TableField(value = "username",  //关联映射,
			insertStrategy = FieldStrategy.DEFAULT, //insertStrategy updateStrategy whereStrategy指定插入，更新，where查询时的sql组装策略
			updateStrategy = FieldStrategy.DEFAULT,
			whereStrategy = FieldStrategy.DEFAULT,
			fill = FieldFill.DEFAULT   //填充策略
	)
	private String username;
	private String password;
	private String loginIp;
	private Date loginTime;
	private Integer openFlag;
	private Date createTime;
	@TableField(exist = false) //用来排除非数据表字段，插入时会排除，也可使用static  transient关键字来排除
	private String notExist;

//	@Version //乐观锁
//	@EnumValue //枚举
//	@TableLogic //逻辑删除
}






















